#ifndef _SYSTEM_H
#define _SYSTEM_H
#include "platform.h"

#define NVIC_ENABLE_DMA_CH1()   do{NVIC->ISER[0] |= (1<<9);}while(0)
#define NVIC_DISABLE_DMA_CH1()  do{NVIC->ICER[0] |= (1<<9);}while(0)

#define NVIC_ENABLE_TIM3()   do{NVIC->ISER[0] |= (1<<16);}while(0)
#define NVIC_DISABLE_TIM3()  do{NVIC->ICER[0] |= (1<<16);}while(0)

#define NVIC_ENABLE_TIM14()   do{NVIC->ISER[0] |= (1<<19);}while(0)
#define NVIC_DISABLE_TIM14()  do{NVIC->ICER[0] |= (1<<19);}while(0)

extern void NVIC_Init(void);
extern void Systick_Init(void);
extern void DelayMs(uint32_t ms);
extern void Systick_Enable(void);
extern void SysTick_Disable(void);
#endif
